<template>
	<view>
		<view class="index-visc-search" >
			<image src="../../static/home/conent/二维码.png" mode=""></image>
			<view class="index-visc-input"><input type="text" v-model="searInput" placeholder="搜索商品优惠卷" /></view>
			<view class="index-viec-right"><image @click="goSecondSearchClick" src="../../static/home/conent/搜索.png" mode=""></image></view>
		</view>
	</view>
</template>

<script>
	
	//vuex映射
	import { mapState, mapActions, mapMutations } from 'vuex';
	export default {
		data() {
			return {
				searInput:""
			}
		},
		methods: {
		//跳转到二级页面让其自己发送请求
		goSecondSearchClick() {
			uni.navigateTo({
				url: `/pages/second-pages/search-content?searInput=${this.searInput}`
			});
			// 输入框置空
			this.searInput = '';
		}
		}
	}
</script>

<style lang="scss">
.index-visc-search {
		width: 100vw;
		position: fixed;
		top: 0;
		height: 80upx;
		z-index: 1;
		display: flex;
		justify-content: space-around;
		background-color: #f8285c;
		border: 2upx solid #f8285c;
		box-sizing: border-box;
		align-items: center;
		image {
			width: 70upx;
			height: 70upx;
		}
		.index-visc-input{
			width: 70%;
			height: 70upx;
			background-color: #FFFFFF;
			border-radius: 2%;
			input{
				width: 80%;
				height: 90%;
				margin: 0 auto;
			}
		}
		.index-viec-right {
			width: 70upx;
			height: 70upx;
			border-radius: 10%;
			background-color: #FFFFFF;
			justify-content: center;
			align-items: center;
			display: flex;
			image{
				width: 60%;
				height: 60%;
			}
		}
	}
</style>
